home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / packet / p_aa4re / bb212src / bbrfwd.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-02-16  |  3.2 KB  |  92 lines

  1. (*===========================================================================*)
  2. (* Reverse forward                                                           *)
  3. (*                                                                           *)
  4. (*   Copyright 1988, 1989, 1990, 1991 by H. Roy Engehausen.  All rights      *)
  5. (*   reserved.                                                               *)
  6. (*                                                                           *)
  7. (*===========================================================================*)
  8.  
  9. (*===========================================================================*)
  10. (* Execute reverse forward                                                   *)
  11. (*===========================================================================*)
  12.  
  13. FUNCTION reverse_forward : BOOLEAN;
  14.  
  15.   VAR
  16.     path_common  : path_block;
  17.  
  18.   PROCEDURE ready_exit;
  19.     BEGIN;
  20.  
  21.       window_write(active_tcb^.port_chan_s + '::', 'Reverse forward ended');
  22.       send_message(message_rfwd_done);
  23.       reverse_forward := path_common.path_did_msg;
  24.  
  25.     END;
  26.  
  27.   BEGIN;
  28.  
  29.     {$IFDEF DEBUG_PORT}
  30.       trace_data('RF 1', 0, active_port, '');
  31.     {$ENDIF}
  32.  
  33.     window_write(active_tcb^.port_chan_s + '::', 'Reverse forward started');
  34.  
  35.     FILLCHAR(path_common, SIZEOF(path_common), CHR(0));
  36.  
  37.     WITH path_common DO
  38.       BEGIN;
  39.         path_pattern := active_tcb^.uid_data.user_id;
  40.         path_rev     := TRUE;
  41.         path_port_p  := '*';
  42.       END;
  43.  
  44.     (*-----------------------------------------------------------------------*)
  45.     (* Mark TCB                                                              *)
  46.     (*-----------------------------------------------------------------------*)
  47.  
  48.     active_tcb^.tcb_rev_fwd := TRUE;
  49.  
  50.     (*-----------------------------------------------------------------------*)
  51.     (* Do the routes                                                         *)
  52.     (*-----------------------------------------------------------------------*)
  53.  
  54.     {$IFDEF DEBUG_PORT}
  55.       trace_data('RF 2', 0, active_port, '');
  56.     {$ENDIF}
  57.  
  58.     do_route;
  59.  
  60.     (*-----------------------------------------------------------------------*)
  61.     (* Now the path                                                          *)
  62.     (*-----------------------------------------------------------------------*)
  63.  
  64.     {$IFDEF DEBUG_PORT}
  65.       trace_data('RF 3', 0, active_port, '');
  66.     {$ENDIF}
  67.  
  68.     IF NOT msg_route_force THEN
  69.       do_path(@path_common);
  70.  
  71.     (*-----------------------------------------------------------------------*)
  72.     (* Clean up our mess                                                     *)
  73.     (*-----------------------------------------------------------------------*)
  74.  
  75.     {$IFDEF DEBUG_PORT}
  76.       trace_data('RF 4', 0, active_port, '');
  77.     {$ENDIF}
  78.  
  79.     free_semaphore(semaphore_fwd_route_use);
  80.  
  81.     (*-----------------------------------------------------------------------*)
  82.     (* Make ready to go bye bye                                              *)
  83.     (*-----------------------------------------------------------------------*)
  84.  
  85.     {$IFDEF DEBUG_PORT}
  86.       trace_data('RF 5', 0, active_port, '');
  87.     {$ENDIF}
  88.  
  89.     ready_exit;
  90.  
  91.   END;
  92.